using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityGameFramework.Runtime;

public class HotUpdater : MonoBehaviour
{
    public InputField inputField;
    public Button downLoadBtn;
    public int taskID = -1;
    // Start is called before the first frame update
    void Start()
    {
        downLoadBtn.onClick.AddListener(() =>
        {
            taskID = GameEntry.GetComponent<DownloadComponent>().AddDownload(Application.persistentDataPath+"/"+"init.lua", $"http://192.168.2.209:7888/LuaFile/init.lua");
            GameEntry.GetComponent<DownloadComponent>().downLoadOnDownloadSuccess = OnDownloadSuccess;
        });
    }

    void OnDownloadSuccess(object sender, GameFramework.Download.DownloadSuccessEventArgs e)
    {
        taskID = -1;
    }

    // Update is called once per frame
    void Update()
    {
        
    }
}
